import {method} from "lodash/util";

export default ({service, request, serviceForMock, requestForMock, mock, faker, tools}) => ({
  /**
   * @description 登录
   * @param {Object} data 登录携带的信息
   */
  SYS_USER_LOGIN(data = {}) {
    // 接口请求
    return request({
      url: '/admin',
      method: 'post',
      data
    })
  },
  SYS_SET_USER_INFO(id, data = {}) {
    return request({
      url: `/admin/${id}`,
      method: "post",
      data
    })
  },
  /**
   * 分页获取信息
   * @param params
   * @returns {*}
   * @constructor
   */
  SYS_GET_USER(params) {
    return request({
      url: "/user",
      method: "get",
      params
    })
  },
  SYS_DEL_USER(id){
    return request({
      url: `/user/${id}`,
      method: "delete"
    })
  },
  SYS_ADD_ADMIN(data){
    return request({
      url:"/admin/register",
      method:"post",
      data
    })
  }
})
